package part14;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.regex.Pattern;

/**
 * @author wcj
 * @Date 2021/5/26 16:21
 * @Version 1.0
 */
public class Part1411 {

    /**
     * Java中通过Class类对象和reflect提供获取类的运行时信息
     *
     * @param args
     */
    public static void main(String[] args) {
        int lines = 0;
        try {
            Class<?> c = Class.forName("part14.Part1411");
            Method[] methods = c.getMethods();
            Constructor<?>[] constructors = c.getConstructors();
            for (Method method : methods) {
                System.out.println(method.getName());
            }
            for (Constructor<?> constructor : constructors) {
                System.out.println(constructor.getName());
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

    }
}
